home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2435 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: earth.superlink.net!usenet
  2. From: ananda@mars.superlink.net (Ananda Subramaniam)
  3. Newsgroups: comp.os.ms-windows.programmer.ole,comp.lang.c++
  4. Subject: Problems VC++4.0 & StringFromCLSID function
  5. Date: Wed, 17 Jan 1996 20:43:26 GMT
  6. Organization: SuperNet Inc. (908) 828-8988
  7. Message-ID: <4djn2d$mps@earth.superlink.net>
  8. NNTP-Posting-Host: p100.superlink.net
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. Hi,
  12.  
  13. I have an OLE sample that I wrote and compiled in VC++ 2.0 without any problems.
  14. However, when I tried to compile in VC++ 4.0, I had trouble with the
  15. StringFromCLSID function. 
  16.  
  17. I get a message "cannot convert 2nd parameter char ** to unsigned short**"
  18.  
  19. The Prototype for StringFromCLSID is:
  20. StringFromCLSID(REFCLSID, LPOLESTR *);
  21.  
  22. I am passing as my second parameter a LPSTR *, which shouldn't be a problem
  23. because grepping through the several include files provided by MS there is a
  24. typedef as follows
  25.  
  26. typedef LPSTR LPOLESTR;
  27.  
  28. The compiler seems to think that LPOLESTR is of type unsigned short.
  29. To further confirm this, I changed the type of my string to LPOLESTR and the 
  30. compiler went past StringFromCLSID function but complained on the next line
  31. where I had AfxMessageBox(mystr).  The compiler said "non of the 2 overloads can
  32. covert parameter one from type unsigned short * "
  33.  
  34. After this, I went and modified the header file that has the prototype for
  35. StringFromCLSID (objbase.h) and modified the prototype from LPOLESTR to LPSTR
  36. and the app compiled and sort of worked.  
  37.  
  38. I am running out of ideas, plus it does not help being the only C++ programmer
  39. in the office.   Any help will be appreciated.
  40.  
  41. Ananda
  42. email: ananda@mars.superlink.net
  43.  
  44.  
  45.